package edu.thu.thss.yxy.sip.security;

/**
 * The credentials class is used to store
 * 
 * @author Andy Gao
 * 
 */
@SuppressWarnings("static-access")
public class UserCredentials {
	private static String userName = null;
	private static char[] password = null;

	/**
	 * Sets the user name.
	 * 
	 * @param userName
	 *            The user name to set.
	 */
	
	public void setUserName(String userName) {
		this.userName = userName;
	}

	public static void clean() {
		userName = null;
		password = null;
	}

	public static String getUser() {
		return userName;
	}

	/**
	 * Returns the user name.
	 * 
	 * @return the user name.
	 */
	public String getUserName() {
		return this.userName;
	}

	/**
	 * Sets the user password.
	 * 
	 * @param passwd
	 *            The password associated with username
	 */
	public void setPassword(char[] passwd) {
		this.password = passwd;
	}

	/**
	 * Returns these credentials' password
	 * 
	 * @return these credentials' password
	 */
	public char[] getPassword() {
		return password;
	}
}
